{php include pubTemplate("header")}
<div class="container">


  <nav aria-label="breadcrumb" class="position-relative">
    <ol class="breadcrumb">
      <li class="breadcrumb-item"><a href="{SITE_URL}">首页</a></li>
      <li class="breadcrumb-item active" aria-current="page">{$TS_APP['appname']}</li>
    </ol>

      <a class="btn btn-sm btn-info position-absolute" style="z-index: 100;top:6px;right:6px;" href="{tsUrl('article','add')}">发布文章</a>

  </nav>


    <div class="mb-3">
        <a class="btn btn-sm {if $cateid=='0'}btn-outline-secondary{else}text-secondary{/if}" href="{tsUrl('article')}">全部</a>
        {loop $arrCate $key $item}
        <a class="btn btn-sm {if $cateid==$item['cateid']}btn-outline-secondary{else}text-secondary{/if}" href="{tsUrl('article','cate',array('id'=>$item['cateid']))}">{$item['catename']}</a>
        {/loop}
    </div>


<div class="row">



<div class="col-md-8">


    <div class="card">
        <div class="card-body">
            <h1 class="h5 font-weight-bold text-info">
                {if $strCate}
                {$strCate['catename']}
                {else}
                {$TS_APP['appname']}
                {/if}
            </h1>

            {if $strCate && $strCate['cateinfo']}
            <div class="c9">
                {tsTitle($strCate['cateinfo'])}
            </div>
            {/if}


            {if $ac=='index'}
            <div class="c9">
                {$TS_APP['appdesc']}
            </div>
            {/if}

        </div>
    </div>




{loop $arrArticle $key $item}

    <div class="card">
        <div class="card-body">


            {if $item['photo']}
            <div class="row">

                <div class="col-md-4">
                    <a href="{tsUrl('article','show',array('id'=>$item['articleid']))}">
                        <img class="mw-100" src="{$item['photo_url']}" />
                    </a>
                </div>
                <div class="col-md-8">

                    <div class="h5 font-weight-bold">
                        <a href="{tsUrl('article','show',array('id'=>$item['articleid']))}">{$item['title']}</a>
                        {if $item['istop']=='1'}
                        <img src="{SITE_URL}public/images/ding.png" width="24" height="24" title="[置顶]" alt="[置顶]" />
                        {/if}
                    </div>

                    <div class="fs12 text-black-50"><a class="text-black-50" href="{tsUrl('user','space',array('id'=>$item['user']['userid']))}">{$item['user']['username']}</a> 发表于 {$item['addtime']}</div>

                    <div class="text-black-50 mt-1">{if $item['gaiyao']}{tsTitle($item['gaiyao'])}{else}暂无概要{/if} (<a href="{tsUrl('article','show',array('id'=>$item['articleid']))}">查看全文</a>)</div>





                    <div class="of c9 mt-3 fs12">

                        <div class="float-left">
                            分类：<a href="{tsUrl('article','cate',array('id'=>$item['cate']['cateid']))}">{$item['cate']['catename']}</a>
                        </div>
                        <div class="float-right">

                            <i class="bi bi-eye"></i> {$item['count_view']}

                            <i class="bi bi-chat-text ml-3"></i> {$item['count_comment']}


                        </div>

                    </div>







                </div>

            </div>


            {else}

            <div class="h5 font-weight-bold">
                <a href="{tsUrl('article','show',array('id'=>$item['articleid']))}">{$item['title']}</a>
                {if $item['istop']=='1'}
                <img src="{SITE_URL}public/images/ding.png" width="24" height="24" title="[置顶]" alt="[置顶]" />
                {/if}
            </div>

            <div class="fs12 text-black-50"><a class="text-black-50" href="{tsUrl('user','space',array('id'=>$item['user']['userid']))}">{$item['user']['username']}</a> 发表于 {$item['addtime']}</div>

            {if $item['score']==0}
            <div class="text-black-50 mt-1">{if $item['gaiyao']}{$item['gaiyao']}{else}暂无概要{/if} (<a href="{tsUrl('article','show',array('id'=>$item['articleid']))}">查看全文</a>)</div>
            {/if}




            <div class="of c9 mt-3 fs12">

                <div class="float-left">
                    分类：<a href="{tsUrl('article','cate',array('id'=>$item['cate']['cateid']))}">{$item['cate']['catename']}</a>
                </div>
                <div class="float-right">

                    <i class="bi bi-eye"></i> {$item['count_view']}
                    <i class="bi bi-chat-text ml-3"></i> {$item['count_comment']}

                </div>

            </div>



            {/if}

        </div>
    </div>

{/loop}


<div class="mt-4">{$pageUrl}</div>



</div>



<div class="col-md-4">


    {if $arrTwoCate}
    <div class="card">
        <div class="card-header">二级分类</div>
        <div class="card-body">
            {loop $arrTwoCate $key $item}
            <a class="btn btn-sm {if $cateid==$item['cateid']}btn-outline-secondary{/if}" href="{tsUrl('article','cate',array('id'=>$item['cateid']))}">{$item['catename']}</a>
            {/loop}
        </div>
    </div>
    {/if}



    <div class="card">
        <div class="card-header">推荐阅读</div>
        <div class="card-body">
            <div class="commlist">
                <ul>
                    {loop $arrRecommend $key $item}
                    <li><a href="{tsUrl('article','show',array('id'=>$item['articleid']))}">{$item['title']}</a></li>
                    {/loop}
                </ul>
            </div>
        </div>
    </div>

  <div class="card">
    <div class="card-header">一周热门</div>
    <div class="card-body">
<div class="commlist">
<ul>
{loop $arrHot7 $key $item}
<li><a href="{tsUrl('article','show',array('id'=>$item['articleid']))}">{$item['title']}</a></li>
{/loop}
</ul>
</div>
</div>
</div>

  <div class="card">
    <div class="card-header">一月热门</div>
    <div class="card-body">
<div class="commlist">
<ul>
{loop $arrHot30 $key $item}
<li><a href="{tsUrl('article','show',array('id'=>$item['articleid']))}">{$item['title']}</a></li>
{/loop}
</ul>
</div>
</div>
</div>


<!--广告位-->
{php doAction('gobad','300')}


</div>





</div>
</div>

{php include pubTemplate("footer")}